commit: Allow skipping automatic summary generation
authorDan Nicholson <nicholson@endlessm.com>
Tue, 15 Oct 2019 22:31:23 +0000 (16:31 -0600)
committerDan Nicholson <dbn@endlessos.org>
Tue, 7 Feb 2023 21:50:47 +0000 (14:50 -0700)
If a commit is being made during summary generation, then it would
trigger the summary to be generated again. That's either unwanted busy
work or could result in an infinite loop. Add a boolean in
`OstreeRepoTxn` to disable automatic summary generation as seen fit.

src/libostree/ostree-repo-commit.c
src/libostree/ostree-repo-private.h

index 6328635175b0a4a068ec75e5713525f9e711167c..51bfd46e943879f8b0a72b7a68ca68c29c575e7f 100644 (file)
@@ -2350,7 +2350,8 @@ ostree_repo_commit_transaction (OstreeRepo                  *self,
   /* Update the summary if auto-update-summary is set, because doing so was
    * delayed for each ref change during the transaction.
    */
-  if ((self->txn.refs || self->txn.collection_refs) &&
+  if (!self->txn.disable_auto_summary &&
+      (self->txn.refs || self->txn.collection_refs) &&
       !_ostree_repo_maybe_regenerate_summary (self, cancellable, error))
     return FALSE;
 
index 18e0199e2d451e6cfc02986bf6c03b72dffbbfc4..9a0ea2bedd058c3c0d00a5c9383cb2b191fab0c6 100644 (file)
@@ -101,6 +101,7 @@ typedef struct {
   /* Implementation of min-free-space-percent */
   gulong blocksize;
   fsblkcnt_t max_blocks;
+  gboolean disable_auto_summary;
 } OstreeRepoTxn;
 
 typedef struct {